function cleanup {
	rm -R $1
}

echo Listening on $1
first=1
trap "cleanup; exit 1" SIGINT SIGSTOP
exec 3<"$2"
while read cmd <&3; do
	if [ "$first" ]; then
		exec 4>"$3"
		first=
	fi
	echo $cmd yourself! >&4
done
echo $1 has disconnected
exec 3<&- 4>&-
cleanup "$1"
